home *** CD-ROM | disk | FTP | other *** search
Java Source | 1998-06-30 | 3.0 KB | 96 lines |
- /*
- * @(#)TextUI.java 1.19 98/04/09
- *
- * Copyright (c) 1997 Sun Microsystems, Inc. All Rights Reserved.
- *
- * This software is the confidential and proprietary information of Sun
- * Microsystems, Inc. ("Confidential Information"). You shall not
- * disclose such Confidential Information and shall use it only in
- * accordance with the terms of the license agreement you entered into
- * with Sun.
- *
- * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
- * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
- * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
- * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
- * THIS SOFTWARE OR ITS DERIVATIVES.
- *
- */
- package com.sun.java.swing.plaf;
-
- import com.sun.java.swing.Action;
- import com.sun.java.swing.BoundedRangeModel;
- import java.awt.Point;
- import java.awt.Rectangle;
- import java.awt.Insets;
- import com.sun.java.swing.text.*;
-
- /**
- * Text editor user interface
- *
- * @author Timothy Prinzing
- * @version 1.19 04/09/98
- */
- public abstract class TextUI extends ComponentUI
- {
- /**
- * Converts the given location in the model to a place in
- * the view coordinate system.
- *
- * @param pos the local location in the model to translate >= 0
- * @return the coordinates as a rectangle
- * @exception BadLocationException if the given position does not
- * represent a valid location in the associated document
- */
- public abstract Rectangle modelToView(int pos) throws BadLocationException;
-
- /**
- * Converts the given place in the view coordinate system
- * to the nearest representative location in the model.
- *
- * @param pt the location in the view to translate. This
- * should be in the same coordinate system as the mouse
- * events.
- * @returns the offset from the start of the document >= 0
- */
- public abstract int viewToModel(Point pt);
-
- /**
- * Causes the portion of the view responsible for the
- * given part of the model to be repainted.
- *
- * @param p0 the beginning of the range >= 0
- * @param p1 the end of the range >= p0
- */
- public abstract void damageRange(int p0, int p1);
-
- /**
- * Fetches the binding of services that set a policy
- * for the type of document being edited. This contains
- * things like the commands available, stream readers and
- * writers, etc.
- *
- * @return the editor kit binding
- */
- public abstract EditorKit getEditorKit();
-
- /**
- * Fetches a View with the allocation of the associated
- * text component (i.e. the root of the hierarchy) that
- * can be traversed to determine how the model is being
- * represented spatially.
- *
- * @return the view
- */
- public abstract View getRootView();
-
- /**
- * Fetches the default margin space for the text ui.
- *
- * @return the margins
- */
- public abstract Insets getDefaultMargin();
-
- }
-